package com.michale.common.properties;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author Michale
 * @apiNote 读取MQTT配置信息
 */
@Data
@Component
@ConfigurationProperties(prefix = "mqtt")
public class MQTTProperties {

    @ApiModelProperty("用户名")
    private String username;

    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("地址")
    private String hostUrl;

    @ApiModelProperty("客户端id")
    private String clientId;

    @ApiModelProperty("订阅主题")
    private String defaultTopic;

    @ApiModelProperty("超时时间")
    private int timeout;

    @ApiModelProperty("心跳")
    private int keepalive;

    @ApiModelProperty("MQTT开关")
    private boolean enabled;

}
